import request from '@/utils/request'


export function getCaptcha() {
    return request({
            url: '/basic/get-captcha',
            method: 'get',
            responseType: "arraybuffer",
            withCredentials: true //绝对不可以省略！！！
            // headers: {"response-type": "arraybuffer"},
        }
    )

}

// 用户登录
export function login(loginForm) {
    // const data = {
    //     username,
    //     password,
    //     captcha,
    // }
    return request({
        url: '/basic/login',
        method: 'post',
        withCredentials: true, //允许跨域时携带Csrc/api/login.jsookie
        data: loginForm
    })
}

export function getPermission() {
    return request({
        url: '/basic/permission',
        method: 'get'
    })
}

export function getName() {
    return request({
        url: '/basic/get-name',
        method: 'get'
    })
}



